home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001108a
< prev
next >
Wrap
Text File
|
1991-11-21
|
2KB
|
112 lines
CMENU Specification Language
----------------------------
Explanation of my "loose BNF" form:
:= reads "is defined as".
Terms in <>s are syntactic objects.
Terms in CAPITALS are keywords.
An item in [] is optional
If a set of items is enclosed in {} with |
between each item, or a range is shown
using the - character, exactly one of
those items must be picked.
* to the right of an object denotes 0
or more occurrences.
+ to the right of an object denotes 1
or more occurrences.
Wherever a separator is necessary to
delimit tokens, the characters ';' and
',' are both valid separators along
with the usual whitespace characters
(space, tab and newline.)
------------------------------------------
<cmenu-source-file> :=
<menu-defn> +
<menu-defn> :=
MENU [<identifer>] :
<menu-option> *
<item-defn> +
ENDMENU
<identifier> :=
{ a-z | A-Z }+ { a-z | A-Z | 0-9 } *
<menu-optiion> :=
PATH <text>
ALIGN { LEFT | CENTER } |
ESCAPE |
NOESCAPE |
SPACING { 1 | 2 } |
COLUMNS <integer>
<integer> :=
{0-9} +
<text> :=
{
"<ascii-string>" |
'<ascii-string>' |
<no-space-string>
}
<item_defn> :=
ITEM [<identifier>] : [<text>]
[<item-option>] *
<action-code>
<item-option> :=
NEXTITEM
{
<identifier> |
FIRST |
LAST |
NEXT
} |
TEXT <text> |
HELP <text> |
PATH <text> |
PROMPT |
PAUSE |
NOPROMPT |
NOPAUSE |
NOPRECLEAR |
PRECLEAR
<action-code> :=
{
ACTION <text> |
EXIT |
LMENU <identifer> |
EMENU <text>
}
<ascii-string> := string containing any
ASCII characters, delimited by either
single (') or double (") quotes.
Line continuation is NOT permitted.
<no-space-string> := string without
quotes, containing no whitespace
characters whatsoever. Terminated
by first whitespace character.
Note: the <text> displayed for any one
item may be specified either as an
<item-option> (the TEXT clause) or
immediately following the colon after
the ITEM declaration. Exactly ONE
of these methods must be used for
each item in the menu file.